package com.leador.http.callback;

import com.leador.http.ResultParse;
import com.leador.manger.LBSTraceClient;
import com.leador.module.response.Result;
import com.leador.module.response.track.TrackCloumnResult;
import com.leador.module.response.track.TrackResult;

/**
 * Created by liuha on 2016/9/18.
 */
public class TraceCallback {
    public static void traceCallBack(int status,String msg){
        if(LBSTraceClient.onTrackListener == null){
            return;
        }
        Result result;
        switch (status){
            case 0:
                result = ResultParse.resultParse(msg);
                LBSTraceClient.onTrackListener.onRequestFailedCallback(result);
                break;
            case 1:
                //TODO 单点上报
                break;
            case 2:
               //TODO 批量上报
                break;
            case 3:
                TrackResult trackResult = ResultParse.trackParse(msg);
                LBSTraceClient.onTrackListener.onQueryHistoryTrackCallback(trackResult);
                break;
            case 4:
                result = ResultParse.resultParse(msg);
                LBSTraceClient.onTrackListener.onAddTrackColumn(result);
                break;
            case 5:
                TrackCloumnResult trackCloumnResult = ResultParse.trackCloumnListParse(msg);
                LBSTraceClient.onTrackListener.onQueryTrackColumn(trackCloumnResult);
                break;
            case 6:
                result = ResultParse.resultParse(msg);
                LBSTraceClient.onTrackListener.onDeleteTrackColumn(result);
                break;
        }
    }
}
